package com.fqgj.xjd.user.client.enums;

/**
 * @program: cashmama-user
 * @description
 * @author: frank
 * @create: 2020-04-16 14:06
 **/
public enum UserActivityEnum {
    ACTIVITY(1, "activity"),
    POPUP(2, "popup");

    private Integer code;
    private String  name;

    UserActivityEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public UserActivityEnum setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getName() {
        return name;
    }

    public UserActivityEnum setName(String name) {
        this.name = name;
        return this;
    }

    public static UserActivityEnum getByCode(Integer code){
        if(code == null){
            return null;
        }
        for(UserActivityEnum userActivityEnum : UserActivityEnum.values()){
            if(code == userActivityEnum.getCode()){
                return userActivityEnum;
            }
        }
        return null;
    }
}
